//
//  UIImage+M1Color.m
//  NewMarryU
//
//  Created by apple on 2018/7/21.
//  Copyright © 2018年 Cedar. All rights reserved.
//

#import "UIImage+M1Color.h"

@implementation UIImage (M1Color)
+(UIImage *)m1_imageWithColor:(UIColor *)color{
    CGRect rect = CGRectMake(0.0f, 0.0f, 1, 1);
    UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context, color.CGColor);
    CGContextFillRect(context, rect);
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return image;
}
@end
